package n2545;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	
	static long p[]=new long[3];
	static int v[]= {0,0,0};
	
	static void solve(long p1,long p2,long p3,int x)
	{
		p[0]=p1;
		p[1]=p2;
		p[2]=p3;
		long a[]=new long[x+1];
		a[0]=1;
		for(int i=1;i<=x;i++)
		{
			long min=a[v[0]]*p[0];
			for(int j=1;j<3;j++)
			{
				if(min>a[v[j]]*p[j])min=a[v[j]]*p[j];
			}
			for(int j=0;j<3;j++)
			{
				if(min==a[v[j]]*p[j])v[j]=v[j]+1;
			}
			a[i]=min;
		}
		System.out.println(a[x]);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {

		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer(bf.readLine());
		long p1=Long.parseLong(st.nextToken());
		long p2=Long.parseLong(st.nextToken());
		long p3=Long.parseLong(st.nextToken());
		int x=Integer.parseInt(st.nextToken());
		solve(p1, p2, p3, x);
	}

}
